package com.second.app.template;

public abstract class Action {

    public static final int EAT = 1;
    public static final int WORK = 2;
    public static final int SLEEP = 5;
    public static final int RUN = 10;

    public abstract void eat();

    public abstract void sleep();

    public abstract void run();

    public abstract void work();

    public void command(int ch){
        switch (ch){
            case EAT:
                this.eat();
                break;
            case WORK:
                this.work();
                break;
            case SLEEP:
                this.sleep();
                break;
            case EAT+WORK:
                this.run();
                break;
            case EAT+SLEEP+RUN:
                this.eat();
                this.sleep();
                this.run();
                break;
            case EAT+SLEEP+RUN+WORK:
                this.eat();
                this.sleep();
                this.run();
                this.work();
                break;
        }
    }
}
